<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>

</head>

<body style="overflow:auto;">
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：订单分析</div>
			<div id="topOtherMenu"></div>
		</div>
		<div id="body">
			<div id="search">
				<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl(array('type' => $this->type));?>">
					<table>
						<tr>
							<td>
							<div id="timeRange">
							<span <?php if($this->times=='yestoday'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('times'=>'yestoday'));?>">昨天</a></span>
                            <span <?php if($this->times=='sevenday'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('times'=>'sevenday'));?>">最近7天</a></span>
                            <span <?php if($this->times=='thirtyday'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('times'=>'thirtyday'));?>">最近30天</a></span>
                            <span <?php if($this->times=='threemonth'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('times'=>'threemonth'));?>">最近三个月</a></span>
                            <span <?php if($this->times=='all'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('times'=>'all'));?>">全部</a></span>&nbsp;&nbsp;&nbsp;&nbsp;日期选择：
                            <input name="startTime" type="text" class="input" id="startTime" size="20" value="<?php echo $this->inputTime['startTime'];?>" />
								<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":false,"showOthers":false,"timeFormat":24,"inputField":"startTime","button":"startTime"});</script>
								-
								<input name="endTime" type="text" class="input" id="endTime" size="20" value="<?php echo $this->inputTime['endTime'];?>" />
								<script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":false,"showOthers":false,"timeFormat":24,"inputField":"endTime","button":"endTime"});</script>
								
								&nbsp;
								<input name="search" type="submit" id="search2" value="查找" class="button" />
							</div>
						  </td>
						</tr>
					</table>
				</form>
			</div>
			<div id="search_type">
				<div id="timeRange">
					<table>
						<tr>
							<td>
							<span <?php if($this->type=='1'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('type'=>'1'));?>">渠道</a></span>
							<span <?php if($this->type=='2'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('type'=>'2'));?>">专题</a></span>
							<span <?php if($this->type=='3'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('type'=>'3'));?>">操作系统</a></span>
							<span <?php if($this->type=='4'){ echo 'class="currentTimeRange"';}?>><a href="<?php echo $this->url(array('type'=>'4'));?>">地域</a></span>
							</td>
						</tr>
					</table>
				</div>
			</div>
	
			<div id="content">
			</div>
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
							<td width="15%" align="left"><?php if($this->type=='2'){echo '专题名称';}elseif($this->type=='3'){echo '操作系统名称';}elseif($this->type=='4'){echo '地域名称';}else{echo '渠道名称';}?></td>
							<td width="15%" align="left">订单金额</td>
							<td width="15%" align="left">占比</td>
							<td width="15%" align="left">订单量</td>
							<td width="15%" align="left">占比</td>
							<td width="15%" align="left">客单价</td>
						</tr>
						<?php 
							foreach($this->tmpArray as $item):
						?>
						
						<tr class="dataLine" >
						  <td align="left"><?php echo $item['name'];?></td>
						  <td class="numberTd">￥<?php echo $item['amount'];?></td>
						  <td align="left"><?php echo $item['amountPer'].'%';?></td>
						  <td class="numberTd"><?php echo $item['num'];?></td>
						  <td align="left"><?php echo $item['numPer'].'%';?></td>
						  <td align="left" class="numberTd"><?php echo $item['amountOne'];?></td>
					  	</tr>
						<?php 
							endforeach;
							if(empty($this->tmpArray)):
						?>
						<tr class="dataLine">
						  <td colspan="6" align="left">没有找到相关记录！</td>
					  	</tr>
						<?php
							endif;
							if(!empty($this->tmpArray)):
						?>
						<tr class="dataLine">
							<td align="left">总计</td>
							<td class="numberTd">￥<?php echo $this->totalArray['amountTotal'];?></td>
							<td align="left">100%</td>
							<td align="left" class="numberTd"><?php echo $this->totalArray['numTotal'];?></td>
							<td align="left">100%</td>
							<td align="left" class="numberTd">￥<?php echo $this->totalArray['amountOneTotalPer'];?></td>
						</tr>
						<?php endif;?>
				  </table>
				</form>
		</div>
		</div>
	</div>
</body>
</html>